import request from './request'

const orderUrl = {
  //客户管理
  order: {
    Detail: '/order/pcDetail',
    List: '/order/orderList',
    Select: '/order/select',
    Status: '/order/status',
    platformCreate: '/order/platformCreate',
    customerLogin:'user/customer/login',
     //token 验证
     userValidate:'/user/validate',
     uploadFile: '/file/uploadFile',
    //
  },
}
// 客户接口
const  customer={
  //客户完善信息 新用户注册 ；老客户更新
  update:'customer/update',
  //客户 登录接口
  login:'user/customer/login',
  // 客户详情
  detail:'customer/detail',



  order:{
  // 客户创订单
    mpCreate:'order/mpCreate',
    // 客户订单列表
    customerList:'order/customerList',
    // 客户订单详情
    detail:'order/detail',
    // /order/orderLogs
    // 订单详情日记
    orderLogs:'order/orderLogs',
      // 订单下单传的图片
  orderImages: '/order/orderImages',
  taskUpdate: '/task/update',
  taskConfirm: '/task/confirm',
  },

  //客户联系人
  customerContact:{
    // 联系人详情
    detail:'customerContact/detail',
    // 联系人列表
    list:'customerContact/list',
    // 改变联系状态
    status:'customerContact/status',
    // 更新联系人或者新增
    update:'customerContact/update',
  }

}
//
const cityUrl={
  provinceList: 'city/provinceList',//获取省列表
	cityList: 'city/cityList',
	areaList: 'city/areaList',
}
var baseUrl="http://minarole.com:28080/bmwl/mgrweb-api/"


const api = {
  //
  Register: (paramObj) => request('user/register', paramObj),
  Login: (paramObj) => request('user/login', paramObj),
  // token验证
  userValidate: (paramObj) => request(orderUrl.order.userValidate, paramObj),
  // 客户订单
  OrderList: (paramObj) => request(orderUrl.order.List, paramObj),
  CustomerLogin: (paramObj) => request(orderUrl.order.customerLogin, paramObj),
  orderDetail: (paramObj) => request(customer.order.detail, paramObj),
  orderLogs: (paramObj) => request(customer.order.orderLogs, paramObj),
  orderImages: (paramObj) => request(customer.order.orderImages, paramObj),
  orderImages: (paramObj) => request(customer.order.orderImages, paramObj),
  taskUpdate: (paramObj) => request(customer.order.taskUpdate, paramObj),
  taskConfirm: (paramObj) => request(customer.order.taskConfirm, paramObj),

  customer:{
    Update: (paramObj) => request(customer.update, paramObj),
    Login: (paramObj) => request(customer.login, paramObj),
    Detail: (paramObj) => request(customer.detail, paramObj),

    // 定单
    OrderMpCreate: (paramObj) => request(customer.order.mpCreate, paramObj),
    // 客户订单列表
    customerOrderList: (paramObj) => request(customer.order.customerList, paramObj),
  },
  // 客户联系人
  customerContact:{
    Update: (paramObj) => request(customer.customerContact.update, paramObj),
    List: (paramObj) => request(customer.customerContact.list, paramObj),
    Status: (paramObj) => request(customer.customerContact.status, paramObj),
    Detail: (paramObj) => request(customer.customerContact.detail, paramObj),

  },
  city:{
    provinceList: (paramObj) => request(cityUrl.provinceList, paramObj,false,baseUrl),
    cityList: (paramObj) => request(cityUrl.cityList, paramObj,false,baseUrl),
    areaList: (paramObj) => request(cityUrl.areaList, paramObj,false,baseUrl),

  },
  uploadFile: (paramObj) => request(orderUrl.order.uploadFile, paramObj),
}
export default api
